package com.gxa.admin.service.impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.gxa.service.GoodsRpcVo;
import com.gxa.admin.mapper.GoodsMapper;
import com.gxa.service.GoodsRpcService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * @author lch
 * @date 2024/3/22 11:47
 * @description 商品提供方，继承GoodsRpcService
 **/

//dubbo
@Service
public class GoodsRpcServiceImpl implements GoodsRpcService {

    @Autowired
    private GoodsMapper goodsMapper;

    /**
     * 根据id查询商品详情
     * @param goodsId
     * @return
     */
    @Override
    public GoodsRpcVo findGoodsById(Integer goodsId) {

        return this.goodsMapper.queryGoodsById(goodsId);
    }


    /**
     * 查询所有商品
     * @return
     */
    @Override
    public List<GoodsRpcVo> findAllGoods() {

        return this.goodsMapper.queryAllGoods();
    }
}
